// There are three rules


#include <iostream>
#include <typeinfo>
using namespace std;

double foo( int x, int y ){
	cout << "foo" << endl;
	return 3.14;
}

int main( void ) {
	int a;
	decltype(a) c = a;
	cout << "c type : " << typeid(c).name( ) << endl;
	cout << "&c : " << &c << endl;
	cout << "&a : " << &a << endl;
	c++;

	decltype(foo( 10, 20 )) d = a;
	cout << "d type : " << typeid(d).name( ) << endl;
	cout << "&d : " << &d << endl;
	cout << "&a : " << &a << endl;
	d++;
	
	decltype(++a) e = a;	// e is the a nickname, they have the same address.
	cout << "e type : " << typeid(e).name( ) << endl;
	cout << "&e : " << &e << endl;
	cout << "&a : " << &a << endl;
	e++;

	decltype(a++) f = a;
	cout << "f type : " << typeid(f).name( ) << endl;
	cout << "&f : " << &f << endl;
	cout << "&a : " << &a << endl;
	f++;

	return 0;
}

